///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar  6 2009)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "paneltaskgui.h"

#include "res/edit_add.xpm"
#include "res/edit_del.xpm"
#include "res/finish.xpm"

///////////////////////////////////////////////////////////////////////////

PanelTaskGui::PanelTaskGui( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxVERTICAL );
	
	m_toolbar = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL ); 
	m_toolbar->AddTool( ID_PM_ADD_TASK, wxEmptyString, wxBitmap( edit_add_xpm ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
	m_toolbar->AddTool( ID_PM_FINISH_TASK, wxEmptyString, wxBitmap( finish_xpm ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
	m_toolbar->AddTool( ID_PM_DEL_TASK, wxEmptyString, wxBitmap( edit_del_xpm ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
	m_toolbar->Realize();
	
	bSizer1->Add( m_toolbar, 0, wxEXPAND, 5 );
	
	m_splitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
	m_splitter->SetMinimumPaneSize( 60 );
	m_splitter->Connect( wxEVT_IDLE, wxIdleEventHandler( PanelTaskGui::m_splitterOnIdle ), NULL, this );
	m_panelTodo = new wxPanel( m_splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer2;
	bSizer2 = new wxBoxSizer( wxVERTICAL );
	
	wxStaticText* m_staticText1;
	m_staticText1 = new wxStaticText( m_panelTodo, wxID_ANY, _("Todo"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText1->Wrap( -1 );
	bSizer2->Add( m_staticText1, 0, wxALL|wxEXPAND, 5 );
	
	m_listTaskTodo = new wxListCtrl( m_panelTodo, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
	bSizer2->Add( m_listTaskTodo, 1, wxEXPAND, 5 );
	
	m_panelTodo->SetSizer( bSizer2 );
	m_panelTodo->Layout();
	bSizer2->Fit( m_panelTodo );
	m_panelDone = new wxPanel( m_splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer21;
	bSizer21 = new wxBoxSizer( wxVERTICAL );
	
	wxStaticText* m_staticText11;
	m_staticText11 = new wxStaticText( m_panelDone, wxID_ANY, _("Done"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText11->Wrap( -1 );
	bSizer21->Add( m_staticText11, 0, wxALL|wxEXPAND, 5 );
	
	m_listTaskDone = new wxListCtrl( m_panelDone, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
	bSizer21->Add( m_listTaskDone, 1, wxEXPAND, 5 );
	
	m_panelDone->SetSizer( bSizer21 );
	m_panelDone->Layout();
	bSizer21->Fit( m_panelDone );
	m_splitter->SplitHorizontally( m_panelTodo, m_panelDone, 0 );
	bSizer1->Add( m_splitter, 1, wxEXPAND, 5 );
	
	this->SetSizer( bSizer1 );
	this->Layout();
	
	// Connect Events
	this->Connect( ID_PM_ADD_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnAddTask ) );
	this->Connect( ID_PM_FINISH_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnFinishTask ) );
	this->Connect( ID_PM_DEL_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnDelTask ) );
	m_listTaskTodo->Connect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( PanelTaskGui::OnItemActivated ), NULL, this );
	m_listTaskTodo->Connect( wxEVT_MOTION, wxMouseEventHandler( PanelTaskGui::OnMouseMotion ), NULL, this );
	m_listTaskDone->Connect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( PanelTaskGui::OnItemActivated ), NULL, this );
}

PanelTaskGui::~PanelTaskGui()
{
	// Disconnect Events
	this->Disconnect( ID_PM_ADD_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnAddTask ) );
	this->Disconnect( ID_PM_FINISH_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnFinishTask ) );
	this->Disconnect( ID_PM_DEL_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnDelTask ) );
	m_listTaskTodo->Disconnect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( PanelTaskGui::OnItemActivated ), NULL, this );
	m_listTaskTodo->Disconnect( wxEVT_MOTION, wxMouseEventHandler( PanelTaskGui::OnMouseMotion ), NULL, this );
	m_listTaskDone->Disconnect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( PanelTaskGui::OnItemActivated ), NULL, this );
}
